#include"bitset.hpp"

void TestBitSet()
{
  bitset<100> bs;//存放100个比特位
  bs.set(5);
  cout << bs.test(5) << endl;//1
  bs.Print();
  bs.reset(5);
  cout << bs.test(5) << endl;//0
  bs.flip(5);
  cout << bs.test(5) << endl;//1

  bs.set(10);
  bs.set(20);
  bs.set(30);
  cout << bs.count() << endl;//4

  bitset<5> bs2;
  bs2.set(1);
  bs2.set(2);
  bs2.set(3);
  bs2.set(4);
  bs2.set(0);
  bs2.Print();
  cout << bs2.all() << endl;
}
int main()
{
  TestBitSet();
  return 0;
}
